package com.atguigu.jxc.controller;

import com.atguigu.jxc.entity.Unit;
import com.atguigu.jxc.service.GoodsUnitService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.awt.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/unit")
public class GoodsUnitController {

    @Autowired
    GoodsUnitService goodsUnitService;
    //查询所有商品单位
    @PostMapping("/list")
    public Map<String,Object> selectGoodsUnit(){
        Map<String,Object> map = new HashMap<>();
        List<Unit> list =goodsUnitService.list();
        map.put("rows",list);
        System.out.println(map.toString());
        return map;

    }


}
